<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var n1=prompt("请输入一个数字","1");
			//var n=parseInt(n1);
			if(isNaN(n1)){
				alert("输入了非法字符");
			}else{
				var n=parseFloat(n1);
				console.log(n);
				alert(n);
			}
			
		</script>
	</head>
	<body>
	</body>
</html>
